home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / demo / server / scripts / fxlights.cs < prev    next >
Encoding:
Text File  |  2005-11-23  |  4.7 KB  |  213 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. //-----------------------------------------------------------------------------
  7. // Hook into the mission editor.
  8.  
  9. function fxLightData::create(%data)
  10. {
  11.    // The mission editor invokes this method when it wants to create
  12.    // an object of the given datablock type.
  13.    %obj = new fxLight() {
  14.       dataBlock = %data;
  15.    };
  16.    return %obj;
  17. }
  18.  
  19.  
  20. //-----------------------------------------------------------------------------
  21.  
  22. datablock fxLightData(LightHalo)
  23. {
  24.    category = "fxLights";
  25.  
  26.    // Dynamic light
  27.    LightOn = false;
  28.    Radius = 1.0;
  29.    Brightness = 1.0;
  30.    Colour = "1 1 1";
  31.  
  32.    // Flare effect
  33.    FlareOn = true;
  34.    FlareTP = true;
  35.    FlareBitmap = "common/lighting/corona";
  36.    FlareColour = "1 1 0.5";
  37.    ConstantSizeOn = false;
  38.    ConstantSize = 0.2;
  39.    NearSize = 1.2;
  40.    FarSize = 0.2;
  41.    NearDistance = 10.0;
  42.    FarDistance = 30.0;
  43.    FadeTime = 0.1;
  44.    BlendMode = 0;
  45.    LinkFlare = true;
  46.    LinkFlareSize = false;
  47.    
  48.    // Brightness animation
  49.    AnimBrightness = true;
  50.    MinBrightness = 0.8;
  51.    MaxBrightness = 1.0;
  52.    BrightnessTime = 0.2;
  53.    LerpBrightness = true;
  54.    BrightnessKeys = "AZA";
  55.    
  56.    // Color animation
  57.    AnimColour = false;
  58.    MinColour = "0 0 0";
  59.    MaxColour = "1 1 1";
  60.    ColourTime = 1.0;
  61.    LerpColour = true;
  62.    SingleColourKeys = true;
  63.    RedKeys = "AZA";
  64.    GreenKeys = "AZA";
  65.    BlueKeys = "AZA";
  66.  
  67.    // Radius animation
  68.    AnimRadius = false;
  69.    MinRadius = 0.1;
  70.    MaxRadius = 20.0;
  71.    RadiusTime = 5.0;
  72.    LerpRadius = true;
  73.    RadiusKeys = "AZA";
  74.    
  75.    // Offset animation
  76.    AnimOffset = false;
  77.    StartOffset = "-5 0 0";
  78.    EndOffset = "5 0 0";
  79.    OffsetTime = 5.0;
  80.    LerpOffset = true;
  81.    OffsetKeys = "AZA";
  82.    
  83.    // Rotation animation
  84.    AnimRotation = false;
  85.    MinRotation = 0;
  86.    MaxRotation = 350;
  87.    RotationTime = 5.0;
  88.    LerpRotation = true;
  89.    RotationKeys = "AZA";
  90. };
  91.  
  92. //-----------------------------------------------------------------------------
  93.  
  94. datablock fxLightData(FlameLight)
  95. {
  96.    category = "fxLights";
  97.  
  98.    // Dynamic light
  99.    LightOn = true;
  100.    Radius = 3.0;
  101.    Brightness = 1.0;
  102.    Colour = "1 1 0.5";
  103.  
  104.    // Flare effect
  105.    FlareOn = true;
  106.    FlareTP = true;
  107.    FlareBitmap = "common/lighting/corona";
  108.    FlareColour = "1 1 0.5";
  109.    ConstantSizeOn = false;
  110.    ConstantSize = 0.2;
  111.    NearSize = 0.5;
  112.    FarSize = 0.2;
  113.    NearDistance = 10.0;
  114.    FarDistance = 30.0;
  115.    FadeTime = 0.1;
  116.    BlendMode = 0;
  117.    LinkFlare = true;
  118.    LinkFlareSize = false;
  119.    
  120.    // Brightness animation
  121.    AnimBrightness = true;
  122.    MinBrightness = 0.8;
  123.    MaxBrightness = 1.0;
  124.    BrightnessTime = 0.2;
  125.    LerpBrightness = true;
  126.    BrightnessKeys = "AZA";
  127.    
  128.    // Color animation
  129.    AnimColour = false;
  130.    MinColour = "0 0 0";
  131.    MaxColour = "1 1 1";
  132.    ColourTime = 1.0;
  133.    LerpColour = true;
  134.    SingleColourKeys = true;
  135.    RedKeys = "AZA";
  136.    GreenKeys = "AZA";
  137.    BlueKeys = "AZA";
  138.  
  139.    // Radius animation
  140.    AnimRadius = false;
  141.    MinRadius = 0.1;
  142.    MaxRadius = 20.0;
  143.    RadiusTime = 5.0;
  144.    LerpRadius = true;
  145.    RadiusKeys = "AZA";
  146.    
  147.    // Offset animation
  148.    AnimOffset = false;
  149.    StartOffset = "-5 0 0";
  150.    EndOffset = "5 0 0";
  151.    OffsetTime = 5.0;
  152.    LerpOffset = true;
  153.    OffsetKeys = "AZA";
  154.    
  155.    // Rotation animation
  156.    AnimRotation = false;
  157.    MinRotation = 0;
  158.    MaxRotation = 350;
  159.    RotationTime = 5.0;
  160.    LerpRotation = true;
  161.    RotationKeys = "AZA";
  162. };
  163.  
  164.  
  165. //-----------------------------------------------------------------------------
  166.  
  167. datablock ParticleData(FlameSmoke)
  168. {
  169.    textureName          = "~/data/shapes/particles/smoke";
  170.    dragCoefficient     = 0.0;
  171.    gravityCoefficient   = -0.2;   // rises slowly
  172.    windCoefficient      = 0;
  173.    inheritedVelFactor   = 0.00;
  174.    lifetimeMS           = 2000;
  175.    lifetimeVarianceMS   = 250;
  176.    useInvAlpha = false;
  177.    spinRandomMin = -30.0;
  178.    spinRandomMax = 30.0;
  179.  
  180.    colors[0]     = "0.6 0.6 0.6 0.1";
  181.    colors[1]     = "0.6 0.6 0.6 0.1";
  182.    colors[2]     = "0.6 0.6 0.6 0.0";
  183.  
  184.    sizes[0]      = 0.25;
  185.    sizes[1]      = 0.5;
  186.    sizes[2]      = 1.0;
  187.  
  188.    times[0]      = 0.0;
  189.    times[1]      = 0.5;
  190.    times[2]      = 1;
  191. };
  192.  
  193. datablock ParticleEmitterData(FlameSmokeEmitter)
  194. {
  195.    ejectionPeriodMS = 40;
  196.    periodVarianceMS = 5;
  197.  
  198.    ejectionVelocity = 0.25;
  199.    velocityVariance = 0.10;
  200.  
  201.    thetaMin         = 0.0;
  202.    thetaMax         = 90.0; 
  203.  
  204.    particles = FlameSmoke;
  205. };
  206.  
  207. datablock ParticleEmitterNodeData(FlameSmokeEmitterNode)
  208. {
  209.    timeMultiple = 1;
  210. };
  211.  
  212.  
  213.